home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IOInterface / deltaSystem.icl < prev    next >
Encoding:
Modula Implementation  |  1997-04-23  |  2.1 KB  |  84 lines  |  [TEXT/3PRM]

  1. implementation module deltaSystem;
  2.  
  3. from StdString import String;
  4. import    StdReal, StdInt;
  5. import    quickdraw, pointer;
  6. from    windowAccess    import ScrollBarWidth, TitleBarWidth, MenuBarWidth, WindowScreenBorder;
  7.  
  8.  
  9. UpKey            :== '\036';        // Arrow up
  10. DownKey            :== '\037';        // Arrow down
  11. LeftKey            :== '\034';        // Arrow left
  12. RightKey        :== '\035';        // Arrow right
  13. PgUpKey            :== '\013';        // Page up
  14. PgDownKey        :==    '\014';        // Page down
  15. BeginKey        :== '\001';        // Begin of text
  16. EndKey            :== '\004';        // End of text
  17. BackSpKey        :== '\010';        // Backspace
  18. DelKey            :== '\177';        // Delete
  19. TabKey            :== '\011';        // Tab
  20. ReturnKey        :== '\015';        // Return
  21. EnterKey        :== '\003';        // Enter
  22. EscapeKey        :== '\033';        // Escape
  23. HelpKey            :== '\005';        // Help
  24.  
  25. DirSeparator    :== ':';        // Separator between folder-
  26.                                 // and filenames in a pathname
  27.  
  28. ShiftOnly        :== (True,False,False,False);
  29. OptionOnly        :== (False,True,False,False);
  30. CommandOnly        :== (False,False,True,False);
  31. ControlOnly        :== (False,False,False,True);
  32.  
  33. MMPerInch        :== 25.4;
  34.  
  35.  
  36. HomePath :: !String -> String;
  37. HomePath fname = fname;
  38.  
  39. ApplicationPath :: !String -> String;
  40. ApplicationPath fname = fname;
  41.  
  42. MMToHorPixels :: !Real -> Int;
  43. MMToHorPixels mm = toInt ((mm * toReal horRes) / MMPerInch);
  44.     where {
  45.         (horRes,_) = LoadWord ScrnHResAddress NewToolbox;
  46.     };
  47.  
  48. MMToVerPixels :: !Real -> Int;
  49. MMToVerPixels mm = toInt ((mm * toReal vertRes) / MMPerInch);
  50.     where {
  51.         (vertRes,_) = LoadWord ScrnVResAddress NewToolbox;
  52.     };
  53.  
  54. InchToHorPixels :: !Real -> Int;
  55. InchToHorPixels inch = toInt (inch * toReal horRes);
  56.     where {
  57.         (horRes,_) = LoadWord ScrnHResAddress NewToolbox;
  58.     };
  59.  
  60. InchToVerPixels    :: !Real -> Int;
  61. InchToVerPixels inch = toInt (inch * toReal vertRes);
  62.     where {
  63.         (vertRes,_) = LoadWord ScrnVResAddress NewToolbox;
  64.     };
  65.  
  66.  
  67. MaxScrollWindowSize :: (!Int, !Int);
  68. MaxScrollWindowSize
  69.     =    (sR-ScrollBarWidth-dScrwW, sB-dScrwW-ScrollBarWidth-TitleBarWidth-MenuBarWidth);
  70.     where {
  71.         dScrwW                = 2*WindowScreenBorder;
  72.         (sL,sT, sR,sB, _)    = QScreenRect NewToolbox;
  73.     };
  74.  
  75. MaxFixedWindowSize :: (!Int, !Int);
  76. MaxFixedWindowSize
  77.     =    (w+ScrollBarWidth, h+ScrollBarWidth);
  78.     where {
  79.         (w, h) = MaxScrollWindowSize;
  80.     };
  81.  
  82.  
  83.